{% extends "qa_base.html" %}

{% block content %}
<div id="wrapper">
    <div id="room">
        <div id="CALeft">
            <div class="headNormal">
                <h1> {{question.title}}</h1>
            </div>
            <div id="main-body" class="">
                <div id="askform">
                    <table style="width:100%;" id="question-table" >
                        <tr>
                            <td style="width:30px;vertical-align:top">
                            <div class="vote-buttons">
                               <a id="post-{{question.id}}-upvote" title="I like this post (click again to cancel)"

    class="ajax-command post-vote up question {% if user in question.pro_record.all %}on{% endif %}"

     href="/qa/vote/question/{{question.id}}/up/" rel="nofollow" {% if user %}onclick = "return false"{% endif %}>
     <p style="visibility:hidden;" id = "hint">{{question.id}}</p> </a>

<div id="post-question-{{question.id}}-score" class="post-score"

    title="当前总票数">

    {{question.vote_count}}

</div>

<a id="post-{{question.id}}-downvote" title="I dont like this post (click again to cancel)"

    class="ajax-command post-vote down question {% if user in question.against_record.all %}on{% endif %}"

     href="/qa/vote/question/{{question.id}}/down/" rel="nofollow" {% if user %}onclick = "return false"{% endif %}> </a>

                            



<a id="favorite-mark" title="mark/unmark this question as favorite (click again to cancel)"

    class="ajax-command favorite-mark {% if user in question.favourite_record.all %}on{% endif %}"

    href="/qa/mark_favorite/{{question.id}}/" rel="nofollow" {% if user %}onclick = "return false"{% endif %}> </a>
                                <div id="favorite-count" class="favorite-count"></div>
                            </div></td>
                            <td>
                            <div id="item-right">
                                <div class="question-body">
                                    <p>
                                        {{question.description|safe}}
                                    </p>
                                </div>
                                <div id="question-tags" class="tags-container tags">
                                    {% for tag in question.tags.all %} <a href="/qa/tags/{{tag.name}}/" class="post-tag tag-link-{{tag.name}}"

                                    title="see questions tagged '{{tag.name}}'" rel="tag">{{tag.name|slice:':12'}}{%if tag.name|length >= 12 %}..{%endif%}</a>
                                    {% endfor %}
                                </div>
                                <div id="question-controls" class="post-controls">
                                    <br/>
                                    <!-- JiaThis Button BEGIN -->
                                    <!--
                                    <a href="http://www.jiathis.com/share/?uid=1500189" class="jiathis" target="_blank"><img src="http://v1.jiathis.com/code/images/jiathis2.gif" border="0" /></a>      -->
                                    <!-- JiaThis Button END -->
                                </div>
                                <div class="post-update-info-container">
                                    <div class='post-update-info post-update-info-user'>
                                        <p style="line-height:12px;">
                                            提问于 <strong>{{question.question_datetime|timesince}}</strong>前
                                        </p>
                                        <!-- <img class="gravatar" width="32" height="32" src="http://www.gravatar.com/avatar/b816e2f20337634bb08da8186cc7243c?s=32&amp;d=identicon&amp;r=g" alt="para's gravatar image" />  -->
                                        <p><a href="/qa/questions/users/{{user.id}}/"><img class="gravatar" width="32" height="32" src="{% if user.image %}/{{user.image}}{%endif%}{%if not user.image%}/user_image/2011/08/05/test-image_1.jpg{%endif%}" alt="{{user.name}}'s  image" /></a>
                                            <a href="/qa/questions/users/{{question.questioner.id}}">{{question.questioner.name}}</a>
                                          <br/><span title="{{user.questions.all|length}} questions">{{user.questions.all|length}}</span><span class="badge1">&#9679;</span><span class="badgecount" title = '{{user.answer_set.all|length}} answers'>{{user.answer_set.all|length}}</span>
                                        <!--      <span class="score" title="1 reputation points">1</span><span title="1 奖牌榜"><span class="bronze">&#9679;</span><span class="badgecount">1</span></span>-->
                                        </p>
                                    </div>
                                   <!-- <div class='post-update-info post-update-info-edited'>
                                        <p style="line-height:12px;">
                                            <a href="/revisions/2743/"> edited <strong>2 days ago</strong> </a>
                                        </p>
                                    </div>-->
                                </div>
                                <div class="comments-container" id="comments-container-2743"></div>
                            </div></td>
                        </tr>
                    </table>
                    <hr/>
                    <div class="tabBar">
                        <a name="sort-top"></a>
                        <div class="headQuestions">
                            共有 {{answer_num}} 个回答:
                        </div>
                        <!-- <div class="tabsA"><a href="/questions/2743/append?sort=最先加入" title="最先回答显示在最前面">最先回答</a><a href="/questions/2743/append?sort=最新问题" title="最晚回答显示在最前面">最近回答</a><a href="/questions/2743/append?sort=票" class="on" title="投票次数最多的显示在最前面">投票最多</a></div> -->
                    </div>
                    {% for answer in answer_list%} 
                    <a name="{{answer.id}}"></a>
                    <div id="answer-container-{{answer.id}}" class="answer answered-by-owner">
                        <table style="width:100%;">
                            <tr>
                                <td style="width:30px;vertical-align:top">
                                <div class="vote-buttons">
                                   <a id="post-answer- {{answer.id}} -upvote" title="I like this post (click again to cancel)"

    class="ajax-command post-vote up answer {% if user in answer.pro_record.all %}on{% endif %}"

     href="/qa/vote/answer/{{answer.id}}/up/" rel="nofollow" {% if user %}onclick = "return false"{% endif %}> </a>

<div id="post-answer-{{answer.id}}-score" class="post-score"

    title="当前总票数">

    {{answer.vote_count}}

</div>

<a id="post-answer- {{answer.id}} -downvote" title="I dont like this post (click again to cancel)"

    class="ajax-command post-vote down answer {% if user in answer.against_record.all %}on{% endif %}"

     href="/qa/vote/answer/{{answer.id}}/down/" rel="nofollow" {% if user %}onclick = "return false"{% endif %}> </a>

 
                                </div></td>
                                <td>
                                <div class="item-right">
                                    <div class="answer-body">
                                        <p>
                                            {{answer.description|safe}}
                                        </p>
                                    </div>
                                    <div class="post-update-info-container">
                                        <div class='post-update-info post-update-info-user'>
                                            <p style="line-height:12px;">
                                                回答于 <strong>{{answer.answer_datetime|timesince}}</strong>前
                                            </p>
                                            <!-- <img class="gravatar" width="32" height="32" src="http://www.gravatar.com/avatar/b816e2f20337634bb08da8186cc7243c?s=32&amp;d=identicon&amp;r=g" alt="para's gravatar image" />  -->
                                            <p>
                                                <a href="/qa/questions/users/{{user.id}}/"><img class="gravatar" width="32" height="32" src="{% if user.image %}/{{user.image}}{%endif%}{%if not user.image%}/user_image/2011/08/05/test-image_1.jpg{%endif%}" alt="{{user.name}}'s  image" /></a><a href="/qa/questions/users/{{answer.answerer.name}}">{{answer.answerer.name}}</a>
                                              <br/>
                                              <span title="{{user.questions.all|length}} questions">{{user.questions.all|length}}</span><span class="badge1">&#9679;</span><span class="badgecount" title = '{{user.answer_set.all|length}} answers'>{{user.answer_set.all|length}}</span>
                                     <!--             <span class="score" title="1 reputation points">1</span><span title="1 奖牌榜"><span class="bronze">&#9679;</span><span class="badgecount">1</span></span>-->
                                            </p>
                                        </div>
                                    </div>
                                </div></td>
                            </tr>
                        </table>
                    </div>
                    </br>
                    {% endfor %} <!--  评论功能 暂时未实现，注释掉  by liuguojun

                    <div id="comment-tools-2746" class="comment-tools">
                    <a href="#" class="add-comment-link">添加评论</a>
                    </div>

                    <div id="comment-2746-form-container" class="comment-form-container">

                    <form id="comment-2746-form" method="post" action="/comment/2746/" accept-charset="utf-8"><div style='display:none;'><input type='hidden'  name='csrfmiddlewaretoken' value='66d2066d71ccb9c45c7809a4870cef4b' /></div>

                    <div class="comment-form-widgets-container">

                    <textarea name="comment" class="commentBox"></textarea>

                    <div class="comment-form-buttons">

                    <span id="comment-2746-chars-left" class="comment-chars-left">

                    <span class="comments-char-left-count">10|600</span>

                    <span class="comments-chars-togo-msg">characters needed</span>

                    <span class="comments-chars-left-msg">characters left</span>

                    </span>

                    <input type="submit" class="comment-submit" value=" comment" />

                    <input type="submit" class="comment-cancel" value=" cancel" />

                    </div>

                    </div>

                    <script type="text/html" class="new-comment-skeleton" id="new-comment-skeleton-2746">

                    <div class="comment not_top_scorer" id="comment-%ID%">

                    <div id="post-%ID%-score" class="comment-score"></div>

                    <div class="comment-text">%COMMENT%</div>

                    <div class="comment-info" id="comment-%ID%-info">

                    <a id="comment-%ID%-edit" href="%EDIT_URL%"

                    class="comment-edit" rel="nofollow"> </a>

                    <a id="comment-%ID%-delete" href="%DELETE_URL%"

                    class="ajax-command comment-delete" rel="nofollow"> </a>

                    <a rel="nofollow" id="comment-%ID%-convert" href="%CONVERT_URL%" title="Convert comment to answer"

                    class="ajax-command comment-convert confirm" rel="nofollow"> </a>

                    <span class="comment-age">(just now)</span>

                    <a class="comment-user" href="%PROFILE_URL%">%USERNAME%</a>

                    </div>

                    </div>

                    </script>

                    </form>

                    </div> -->
                    <div class="paginator-container-left"></div>
                    <!-- 下面是 答案 的编辑器  -->
                    <form id="fmask" action="/qa/add_answer/{{question.id}}/" method="GET" accept-charset="utf-8">
                        <div style='display:none;'>
                            <input type='hidden' id='csrfmiddlewaretoken' name='csrfmiddlewaretoken' value='41f0e10243e609bfc4edf0fc4c184238' />
                        </div>
                        <div style="clear:both"></div>
                        <div style="padding:10px 0 0 0;">
                            <div class="headNormal">
                                您的回答
                            </div>
                        </div>
                        
                        <p class="message">
                            {% if user %}
                            Please only give an answer, no discussions.
                            {% else %}
                            You can answer anonymously and then login.
                            {% endif %}
                        </p>
                        
                        <div id="description" class="" >
                		   {% include "wmd_css.html" %}
               			   {% include "wmd_js.html" %}
                           <div id="wmd-button-bar" class="wmd-panel"></div>
                          <div><textarea rows="10" cols="40" name="description" id="wmd-input" class="processed">{{Description}}</textarea></div>
						 {% if error %}
              				 <h4 class="errorlist">{{error}}</h4> 
                		{% endif %}
                           <div class="preview-toggle">
                        <table width="100%">
                            <tr>
                                <td>
                                    <span id="pre-collapse" title="打开或者关闭Markdown编辑器的实时预览">
                                     <h4> 禁用预览</h4>
                                    </span>
                                </td>
                                <td style="text-align: center;" id="editor-metrics"></td>
                            </tr>
                        </table>  
                          </div>
                           <div id="wmd-preview" class="wmd-panel"></div>
                        </div>
                        <p>
                            <span class="form-error"></span>
                        </p>
                        {%if user%}
                        <input type="submit" value="回答问题"
                        class="submit" style="float:left" />                       
                         &nbsp;&nbsp;&nbsp;&nbsp;<span>请确保你的回答对别人是有帮助的，这里不欢迎无意义的“顶”、“沙发”、“mark一下”等。</span>
                        {% else %}
            			<a href = '/login/' class = 'login'>Login/signup to post your question</a>
                    {% endif %}
                    </form>
                </div>
            </div>
        </div>
        <div id="CARight">
        <div class="boxC" id="editor_side_bar"> 
    <p class="subtitle darkred">Markdown Basics</p> 
    <ul class="list-item"> 
        <li> 
            *italic* or __italic__
        </li> 
        <li> 
			**加粗** 或者 __加粗__ 
        </li> 
        <li> 
            <b>链接</b>:[文本](http://url.com/ "标题")
 
        </li> 
 
        <li> 
            <b>图片</b>?![alt 文本](/path/img.jpg "标题")
 
        </li> 
        <li> 
			列表：
            1.  Foo
            2.  Bar
        </li> 
        <li> 
			to add a line break simply add two spaces to where you would like the new line to be.
        </li> 
        <li> 
			基本的HTML标签也是支持的
        </li> 
    </ul> 
    <p class='info-box-follow-up-links'> 
        <a href="/qa/markdown_help/" target="_blank">有关Markdown详细说明 </a> 
    </p> 
</div> 
            <div class="boxC">
                <p>您正在浏览的问题含有如下标签</p>
                <p class="tags">
                    {% for tag in question.tags.all %}
                    <a rel="tag" title="查看有关'{{tag.name}}'的问题" class="tag-link-{{tag.name}}"  
                    href="/qa/tags/{{tag.name}}/">{{tag.name|slice:':20'}}{%if tag.name|length >= 20 %}..{%endif%}</a>
                    <span class="tag-number">×{{tag.count}}</span>
                    <br/>
                    {% endfor %}
                </p>
                <p> 问题提问于<strong title="{{question.question_datetime}}">{{question.question_datetime|timesince}}前</strong>
        
        
        
        
        
        
        
        </div>
        <div id="tail" style="clear:both;"></div>
    </div>
    <div class="spacer3"></div>
</div>
{% endblock %}
